<template>
	<view class="content_layout">
		<view class="content_layout_proWrap" 
			@click="toProDetail(item._id)" 
			v-for="(item,index) in dataList" 
			:key="item._id">
			<u--image
				width="250rpx"
				height="240rpx"
				:src="item.coverPic"
				errorIcon="/static/images/loginPic.png"
				
			></u--image>
			<view class="info">
				<text class="title">{{item.title}}</text>
				<text class="viceTitle">{{item.viceTitle}}</text>
				<text class="price">{{item.price+'积分'}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			dataList:{
				type:Array,
				default(){
					return []
				}
			}
		},
		data() {
			return {
				
			}
		},
		methods:{
			toProDetail(pid){
				uni.navigateTo({
					url:`/subcom-shop/ProDetail/ProDetail?pid=${pid}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.content_layout{
	height: 100%;
	padding: 20rpx 20rpx 0 20rpx;
	box-sizing: border-box;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	background-color: rgb(244,244,244);
	&_proWrap{
		width: 48%;
		height: 400rpx;
		margin-bottom: 20rpx;
		border-radius: 20rpx;
		background-color: #fff;
		padding: 20rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: center;
		.info{
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			align-items: center;
			.title{
				font-size: 28rpx;
				font-weight: bold;
				color: #555555;
			}
			.viceTitle{
				font-size: 24rpx;
				color: #999;
			}
			.price{
				font-size: 28rpx;
				color: #ff5500;
			}
		}
	}
}
</style>
